/* 
 * File:   ClientLauncher.cpp
 * Author: Xi
 *
 * Created on April 7, 2013, 5:11 AM
 */

#include <cstdlib>
#include"Client.h"

using namespace std;

int fd;

int main(int argc, char **argv) {

    ApplicationLayer app;
    DataLinkLayer dl;
    app.setCarrier("client");
    Client c;
    TCPSocket *soc = new TCPSocket();
    fd = soc->conn(12111, "localhost"); /*connection to server*/
    if (fd > 0) {
        cout << "Connected to server!" << endl;

        bool b = c.isReceivedMsg();
        while (true) {
            b = c.isReceivedMsg();
            if (b == true) {
                c.setReceivedMsg(false);
                c.parseInput("", fd);
                continue;
            }
            continue;
        }
    } else {

    }
}
